// Class AddressResolutionException
// The AddressResolutionException class represents an exception which occurs when performing
// name or ip string resolution(s). The errors that are generated, originates from the gethostbyname()
// or getaddrinfo() functions on which address resolutions are based on.

#ifndef ADDRESS_RESOLUTION_EXCEPTION_H
#define ADDRESS_RESOLUTION_EXCEPTION_H

#include "CppSocketsException.h"
#include "LibraryOptions.h"
#include <netdb.h>

class AddressResolutionException : public CppSocketsException
{
private:
  // Error message description constants
  static const string ERROR_DESC_INFO_UNAVAILABLE;
  static const string ERROR_DESC_HOST_NOT_FOUND;
  static const string ERROR_DESC_RETRY_REQUIRED;
  static const string ERROR_DESC_SERVER_ERROR;
  static const string ERROR_DESC_SYSTEM_ERROR;
  static const string ERROR_DESC_UNDEFINED_ERROR;
	
	void assignErrorDescription();
	
public:
	
	// Error constants
  enum 
  {
     ERROR_INFO_UNAVAILABLE,
     ERROR_HOST_NOT_FOUND,
     ERROR_RETRY_REQUIRED,
     ERROR_SERVER,
     ERROR_SYSTEM,
     ERROR_UNDEFINED
  }
	
	AddressResolutionException(int errorCode);

};

#endif